﻿package mortal.game.manager.mouse
{
    import com.gengine.core.frame.*;
    import com.gengine.global.*;
    import flash.events.*;
    import flash.utils.*;

    public class MouseRightLongPress extends MouseLongPress
    {
        protected var _time:int;
        private static var _instance:MouseRightLongPress;

        public function MouseRightLongPress(param1:Number)
        {
            super(param1);
            return;
        }// end function

        override protected function addUpEvent() : void
        {
            Global.stage.addEventListener("rightMouseUp", this.onTargetMouseUp);
            return;
        }// end function

        override protected function removeUpEvent() : void
        {
            Global.stage.removeEventListener("rightMouseUp", this.onTargetMouseUp);
            return;
        }// end function

        override protected function onTargetMouseUp(event:MouseEvent) : void
        {
            super.onTargetMouseUp(event);
            return;
        }// end function

        override public function onFrameTimer(param1:FrameTimer) : void
        {
            attackProcess();
            return;
        }// end function

        override protected function moveProcess() : void
        {
            this._time = setTimeout(attackProcess, 100);
            return;
        }// end function

        override public function stopLongMode() : void
        {
            super.stopLongMode();
            clearTimeout(this._time);
            return;
        }// end function

        public static function get instance() : MouseRightLongPress
        {
            if (!_instance)
            {
                _instance = new MouseRightLongPress(300);
            }
            return _instance;
        }// end function

    }
}
